import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '/project_provider.dart';
import '/login_screen.dart';
import '/project_list_screen.dart';
import '/vpn_screen.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (context) => ProjectProvider(),
      child: MaterialApp(
        theme: ThemeData(
          primarySwatch: Colors.blue,
          textTheme: const TextTheme(
            bodyMedium: TextStyle(color: Colors.black),
          ),
          dropdownMenuTheme: const DropdownMenuThemeData(
            textStyle: TextStyle(color: Colors.black),
            menuStyle: MenuStyle(
              backgroundColor: WidgetStatePropertyAll(Colors.white),
            ),
          ),
          inputDecorationTheme: const InputDecorationTheme(
            labelStyle: TextStyle(color: Colors.black),
            hintStyle: TextStyle(color: Colors.black54),
          ),
        ),
        darkTheme: ThemeData(
          brightness: Brightness.dark,
          textTheme: const TextTheme(
            bodyMedium: TextStyle(color: Colors.white),
          ),
          dropdownMenuTheme: const DropdownMenuThemeData(
            textStyle: TextStyle(color: Colors.white),
            menuStyle: MenuStyle(
              backgroundColor: WidgetStatePropertyAll(Colors.black),
            ),
          ),
          inputDecorationTheme: const InputDecorationTheme(
            labelStyle: TextStyle(color: Colors.white),
            hintStyle: TextStyle(color: Colors.white70),
          ),
        ),
        themeMode: ThemeMode.system,
        initialRoute: '/login',
        routes: {
          '/login': (context) => const LoginScreen(),
          '/projects': (context) => const ProjectListScreen(),
          '/vpn': (context) => VPNScreen(),
        },
      ),
    );
  }
}
